<!doctype html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>OA管理系统</title>
    <link rel="stylesheet" href="assets/css/style.css">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, width=device-width">
    <meta name="description" content="Bitter Mobile Template">
    <meta name="keywords" content="bootstrap, mobile template, cordova, phonegap, mobile, html, responsive" />
</head>

<body>

    <!-- Page loading -->
    <div class="loading">
        <div class="spinner-grow"></div>
    </div>
    <!-- * Page loading -->

    <!-- App Header -->
    <div class="appHeader">
        <div class="left">
            <a href="#" class="icon goBack">
                <i class="icon ion-ios-arrow-back"></i>
            </a>
        </div>
        <div class="pageTitle">
            工资明细
        </div>
        <div class="right">
        </div>
    </div>
    <!-- * App Header -->

    <!-- App Capsule -->
    <div id="appCapsule">

        <div class="appContent">

            <div class="splashBlock">
                <div class="splashIcon text-primary mt-3 mb-3">
                    <i class="icon ion-ios-wallet"></i>
                </div>

                <div class="sectionTitle text-center">
                    <table class="table table-hover">
                        <thead>
                            <tbody>
                                <tr class="table-active">
                                    <th scope="row">工号：</th>
                                    <td id="eid">xxxxx</td>
                                </tr>
                                <tr>
                                    <th scope="row">流水号：</th>
                                    <td id="serialNum">xxxxxxxx</td>
                                </tr>
                                <tr class="table-active">
                                    <th scope="row">基础工资：</th>
                                    <td id="basicWage">xxxxx元</td>
                                </tr>
                                <tr>
                                    <th scope="row">提成：</th>
                                    <td id="royalty">xxxx元</td>
                                </tr>
                                <tr class="table-active">
                                    <th scope="row">上班天数</th>
                                    <td id="workDays">28天</td>
                                </tr>
                                <tr>
                                    <th scope="row">早退/迟到次数</th>
                                    <td id="leaveEarlyDays">x次</td>
                                </tr>
                                <tr class="table-active">
                                    <th scope="row">工资发放日期</th>
                                    <td id="issueTime">2020年1月2日</td>
                                </tr>
                                <tr>
                                    <th scope="row">转账账号</th>
                                    <td id="accountOther">xxxxxxxxxx</td>
                                </tr>
                                <tr class="table-active">
                                    <th scope="row">月份</th>
                                    <td id="month">xxxxx元</td>
                                </tr>
                                <tr class="table">
                                    <th scope="row">到账薪水</th>
                                    <td id="salary">xxxxx元</td>
                                </tr>

                            </tbody>
                    </table>
                </div>

            </div>

        </div>

    </div>
    <!-- appCapsule -->


    <!-- ///////////// Js Files ////////////////////  -->
    <!-- Jquery -->
    <script src="assets/js/lib/jquery-3.4.1.min.js"></script>
    <!-- Bootstrap-->
    <script src="assets/js/lib/popper.min.js"></script>
    <script src="assets/js/lib/bootstrap.min.js"></script>
    <!-- Owl Carousel -->
    <script src="assets/js/plugins/owl.carousel.min.js"></script>
    <!-- Main Js File -->
    <script src="assets/js/app.js"></script>


    <script type="text/javascript">

        function getUrlParam(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        }

        function time(time) {
            var date = new Date(time);
            Y = date.getFullYear() + '-';
            M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            D = date.getDate() + ' ';
            return Y+M+D
        }

        $(function () {
            $.ajax({
                url: "/OASystem/empinfo/workmoney",
                dataType: "json",
                data: {"id":getUrlParam("id")},
                type: "post",
                success: function (data) {
                    console.log(data)
                    $("#eid").text(data.data.eId);
                    $("#serialNum").text(data.data.serialNum);
                    $("#basicWage").text(data.data.basicWage+'元');
                    $("#royalty").text(data.data.royalty+'元');
                    $("#workDays").text(data.data.workDays+'天');
                    $("#leaveEarlyDays").text(data.data.leaveEarlyDays+'次');
                    $("#issueTime").text(time(data.data.issueTime));
                    $("#accountOther").text(data.data.accountOther);
                    $("#month").text(data.data.month);
                    $("#salary").text(data.data.salary+'元');
                },
                error: function (err) {
                    alert("服务器出错");
                }
            })
        })
    </script>


</body>

</html>